/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client.gui.smilies;

import client.communication.ClientCommunication;
import java.util.Hashtable;
import org.apache.log4j.Logger;

/**
 *
 * @author 
 */
public class CSAXHandlerSmileys {
    //attributen
    private Logger logger = Logger.getLogger(CSAXHandlerSmileys.class);
    private String text,  location;
    private Hashtable<String, String> smilies;

    public CSAXHandlerSmileys() {

    }

    public void startEmoticonLijst() {
        smilies = new Hashtable<String, String>();
    }

    public void endEmoticonLijst() {
        ClientCommunication.getInstance().setSmilies(smilies);
    }

    public void startEmoticon() {

    }

    public void endEmoticon() {
        smilies.put(text, location);
        logger.debug("smiley " + text + " toegevoegd");
    }

    public void setText(String text) {
        if (!text.trim().equals("")) {
            this.text = text;
        }
    }

    public void setLocation(String location) {
        if (!location.trim().equals("")) {
            this.location = location;
        }
    }
}
